package a.f.i;

import a.c.*;
import a.c.e;
import a.d.n;
import a.d.s;
import a.d.t;
import a.d.u;
import a.f.c.h;
import a.f.o;
import a.f.wc;
import a.f.zc;
import a.i.db;

import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.awt.geom.Rectangle2D.Double;
import java.util.*;

class f
{
  private static double a = 30.0D;
  public static final double b = 30.0D;
  private double d = 1.0D;
  private double e = 0.0D;
  private double f = 1.7976931348623157E+308D;
  private double g = 0.0D;
  private x i;
  private ArrayList j;
  private double k = 30.0D;
  d l = new d();
  
  public void a(double paramDouble)
  {
    this.k = paramDouble;
  }
  
  public double a()
  {
    return this.k;
  }
  
  public Map a(o paramo, bb[] paramArrayOfbb, bb parambb)
  {
    boolean bool2 = a.wb;
    boolean bool1 = a.vb;
    bb localbb1 = new bb(parambb);
    HashMap localHashMap = new HashMap();
    int m = 0;
    do
    {
      if (m >= paramArrayOfbb.length) {
        break;
      }
      bb localbb2 = paramArrayOfbb[m];
      z localz = a(paramo, localbb2, localbb1);
      if (!bool2)
      {
        if (bool1) {
          break label138;
        }
        localHashMap.put(localbb2, localz);
      }
      n localn = (n)localz.a();
      double d1 = localn.d().b() - paramo.n(localbb2.m());
      wc.b(paramo, localbb2.l(), 0.0D, d1);
      localbb1.addAll(localbb2);
      m++;
    } while (!bool1);
    label138:
    return localHashMap;
  }
  
  public SortedSet a(o paramo, bb parambb1, bb parambb2, x paramx1, Map paramMap, a.d.w paramw, boolean paramBoolean, c paramc, x paramx2, x paramx3)
  {
    Rectangle localRectangle = paramo.d();
    double d1 = localRectangle.getMinX();
    double d2 = localRectangle.getMaxX();
    ab localab = (ab)paramMap.get(parambb1);
    c_ localc_ = a(paramo, parambb1, paramx1, localab, paramw, paramc, paramx2, paramx3);
    Object localObject = null;
    if (paramBoolean)
    {
      localObject = this.l.a(paramo, parambb2, parambb1, localc_, paramw, true);
    }
    else
    {
      localObject = new TreeSet(b.i_.k);
      b.i_ locali_ = new b.i_(new a.d.w(d1 - (d2 - d1), localc_.g().b()), new a.d.w(d2 + (d2 - d1), localc_.g().b()), 0);
      ((SortedSet)localObject).add(locali_);
    }
    return localObject;
  }
  
  public c_ a(o paramo, bb parambb, x paramx1, ab paramab, a.d.w paramw, c paramc, x paramx2, x paramx3)
  {
    boolean bool2 = a.wb;
    boolean bool1 = a.vb;
    Rectangle localRectangle = paramo.d();
    double d1 = localRectangle.getMinX();
    double d2 = localRectangle.getMaxX();
    double d3 = localRectangle.getMinY();
    double d4 = localRectangle.getMaxY();
    double d5 = d4 - d3;
    Rectangle2D localRectangle2D = wc.a(paramo, parambb.l());
    double d6 = localRectangle2D.getMinY();
    Object localObject3;
    label187:
    double d12;
    label293:
    label460:
    label467:
    double d21;
    if (!bool2) {
      if (paramx2.getBool(parambb.m()))
      {
        localObject1 = new h(paramo);
        localObject2 = parambb.m();
        localObject3 = ((h)localObject1).g((e)localObject2);
        ab localab = ((h)localObject1).h((e)localObject2);
        if ((bool2) || ((localObject3 == null) || ((bool2) || (((ab)localObject3).size() == 0))))
        {
          if (!bool2) {
            if (localab != null)
            {
              if (!bool2) {
                if (localab.size() != 0) {
                  break label187;
                }
              }
            }
            else {
              ((ab)localObject3).a(((e)localObject2).m());
            }
          }
          localab.a(((e)localObject2).n());
        }
        double d8 = d3;
        int i1 = 0;
        d12 = 0.0D;
        m localm2 = ((ab)localObject3).l();
        do
        {
          if (!localm2.e()) {
            break;
          }
          a.c.d locald2 = localm2.a();
          if (bool1) {
            break label293;
          }
          if (!bool2)
          {
            if (paramo.n(locald2.e()) > d8)
            {
              d8 = paramo.n(locald2.e());
              i1 = 1;
              d12 = localRectangle2D.getCenterY() - paramo.n(locald2.f());
            }
            localm2.f();
          }
        } while (!bool1);
        double d14 = d4;
        int i3 = 0;
        d17 = 0.0D;
        m localm3 = localab.l();
        do
        {
          if (!localm3.e()) {
            break;
          }
          a.c.d locald3 = localm3.a();
          if (bool1) {
            break label396;
          }
          if (!bool2)
          {
            if (paramo.n(locald3.f()) < d14)
            {
              d14 = paramo.n(locald3.f());
              i3 = 1;
              d17 = localRectangle2D.getCenterY() - paramo.n(locald3.e());
            }
            localm3.f();
          }
        } while (!bool1);
        label396:
        d18 = 0.0D;
        s locals1 = (s)paramx3.get(localObject2);
        double d20 = locals1.c();
        if ((bool2) || (i1 != 0)) {
          if (!bool2)
          {
            if (i3 != 0)
            {
              if (bool2) {
                break label467;
              }
              d18 = d14 - d8;
            }
          }
          else {
            if (!bool1) {
              break label460;
            }
          }
        }
        d18 = d20;
        d21 = Math.max(d20, d18);
        s locals2 = new s(locals1.b(), d21);
        paramx3.a(localObject2, locals2);
        paramo.a((e)localObject2, locals2);
        double d26 = 0.0D;
        k localk = paramo.c(i.d);
        u localu = u.a(localk.get(localObject2));
        if (!bool2) {
          if (i1 != 0)
          {
            if (bool2) {
              break label573;
            }
            if (i3 != 0)
            {
              if (bool2) {
                break label674;
              }
              d26 = (d14 - d8) / 2.0D;
              if (!bool1) {
                break label666;
              }
            }
          }
        }
        label573:
        if (!bool2) {
          if (i1 != 0)
          {
            if (bool2) {
              break label628;
            }
            if (i3 == 0)
            {
              if (bool2) {
                break label674;
              }
              d26 = d8 + locals2.c() / 2.0D + this.k + localu.b;
              if (!bool1) {
                break label666;
              }
            }
          }
        }
        label628:
        if ((bool2) || ((i1 == 0) && (i3 != 0))) {
          d26 = d14 - locals2.c() / 2.0D - this.k - localu.d;
        }
        label666:
        label674:
        double d22 = d1 - (d2 - d1);
        double d23 = d26;
        double d24 = (d2 - d1) * 3.0D;
        double d25 = d21;
        c_ localc_2 = new c_(d22, d23, d24, d25, new a.d.w(paramw.a(), d26));
        return localc_2;
      }
    }
    Object localObject1 = paramo.B();
    Object localObject2 = parambb.l();
    do
    {
      do
      {
        if (!((a.c.w)localObject2).e()) {
          break;
        }
        localObject3 = ((a.c.w)localObject2).d();
        double d7 = paramo.r((e)localObject3).b() - d6;
        ((x)localObject1).a(localObject3, d7);
        ((a.c.w)localObject2).f();
      } while (!bool1);
    } while (bool2);
    localObject2 = new b_[paramab.size()];
    int m = 0;
    m localm1 = paramab.l();
    do
    {
      if (!localm1.e()) {
        break;
      }
      a.c.d locald1 = localm1.a();
      if (bool1) {
        break label1035;
      }
      double d10;
      if (paramx1.getBool(locald1.e()))
      {
        d10 = paramo.n(locald1.e()) + paramo.t(locald1.e()) / 2.0D + this.k - ((x)localObject1).getDouble(locald1.f());
        localObject2[m] = new b_(d10, b_.d);
      }
      if (!bool2)
      {
        if (paramx1.getBool(locald1.f()))
        {
          d10 = paramo.t(locald1.e());
          d12 = paramo.n(locald1.f()) - paramo.t(locald1.f()) / 2.0D - this.k - d10 - ((x)localObject1).getDouble(locald1.e());
          localObject2[m] = new b_(d12, b_.e);
        }
        m++;
        localm1.f();
      }
    } while (!bool1);
    paramo.a((x)localObject1);
    label1035:
    int n = 0;
    double d9 = 0.0D;
    double d11 = d5;
    double d13 = d5;
    int i2 = 0;
    if (i2 < localObject2.length) {
      label1063:
      if (localObject2[i2] != null) {
        break label1096;
      }
    }
    label1096:
    label1262:
    do
    {
      double d16 = localObject2[i2].c();
      int i4 = 0;
      d18 = d5;
      d19 = d5;
      int i5 = 0;
      do
      {
        if (i5 >= localObject2.length) {
          break label1262;
        }
        if (bool1) {
          break;
        }
        if (localObject2[i5] != null)
        {
          if (!bool2) {
            if (localObject2[i5].c() >= d16)
            {
              if (bool2) {
                break label1194;
              }
              if (localObject2[i5].a() == b_.e)
              {
                d21 = localObject2[i5].c() - d16;
                if ((bool2) || (d21 < d18)) {
                  d18 = d21;
                }
                i4++;
              }
            }
          }
          if (bool2) {
            continue;
          }
          if (localObject2[i5].c() <= d16)
          {
            if (bool2) {
              continue;
            }
            if (localObject2[i5].a() == b_.d)
            {
              d21 = d16 - localObject2[i5].c();
              if ((bool2) || (d21 < d19)) {
                d19 = d21;
              }
              i4++;
            }
          }
        }
        i5++;
      } while (!bool1);
      if (!bool2)
      {
        if (bool2) {
          break label1063;
        }
        if (i4 > n)
        {
          n = i4;
          d9 = d16;
          d13 = d19;
          d11 = d18;
        }
        i2++;
      }
      if (!bool1) {
        break;
      }
      d9 += localRectangle2D.getHeight() / 2.0D;
    } while (bool2);
    label1194:
    double d15 = d1 - (d2 - d1);
    double d18 = (d2 - d1) * 3.0D;
    double d17 = d9 - d13;
    double d19 = d13 + d11;
    c_ localc_1 = new c_(d15, d17, d18, d19, new a.d.w(paramw.a(), d9));
    if ((bool2) || (q.n))
    {
      if (!bool2) {}
      a.vb = !bool1;
    }
    if (q.o) {
      a.wb = !bool2;
    }
    return localc_1;
  }
  
  private z a(o paramo, bb parambb1, bb parambb2)
  {
    boolean bool2 = a.wb;
    boolean bool1 = a.vb;
    double d1 = paramo.d().getWidth();
    double d2 = paramo.d().getHeight();
    double d3 = paramo.d().getMinX() - d1;
    double d4 = paramo.d().getMinX() + 2.0D * d1;
    double d5 = paramo.d().getMinY() - d2;
    double d6 = paramo.d().getMinY() + 2.0D * d2;
    Rectangle2D localRectangle2D = wc.a(paramo, parambb1.l());
    double d7 = localRectangle2D.getHeight();
    z localz = new z();
    int m = 0;
    int n = a(paramo, parambb2);
    int i1 = n;
    int i2 = 0;
    int i3 = 0;
    a.c.w localw = parambb1.l();
    Object localObject1;
    Object localObject2;
    label264:
    label334:
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        e locale = localw.d();
        if (bool1) {
          break label669;
        }
        localObject1 = locale.p();
        int i5;
        do
        {
          do
          {
            if (!((a.c.w)localObject1).e()) {
              break;
            }
            localObject2 = ((a.c.w)localObject1).d();
            if (bool1) {
              break label264;
            }
            if (parambb2.contains(localObject2))
            {
              i2++;
              i5 = this.i.getInt(localObject2);
              if (bool2) {
                continue;
              }
              if (i5 > m) {
                m = i5;
              }
            }
            ((a.c.w)localObject1).f();
          } while (!bool1);
        } while (bool2);
        localObject1 = locale.q();
        do
        {
          if (!((a.c.w)localObject1).e()) {
            break label334;
          }
          localObject2 = ((a.c.w)localObject1).d();
          if (bool1) {
            break;
          }
          if (parambb2.contains(localObject2))
          {
            i3++;
            i5 = this.i.getInt(localObject2);
            if (bool2) {
              continue;
            }
            if (i5 < i1) {
              i1 = i5;
            }
          }
          ((a.c.w)localObject1).f();
        } while (!bool1);
        localw.f();
      } while (bool2);
    } while (!bool1);
    if (!bool2)
    {
      if (!bool2)
      {
        if (m < i1 - 1)
        {
          if (!bool2) {
            if (i2 == 0)
            {
              if (bool2) {
                break label452;
              }
              if (i3 == 0)
              {
                double d8 = ((Double)this.j.get(0)).doubleValue();
                localObject1 = new n(new a.d.w(d3, d8), new a.d.w(d4, d8));
                localz.add(localObject1);
                break label716;
              }
            }
          }
          label452:
          int i4 = m + 1;
          do
          {
            do
            {
              if (i4 >= i1) {
                break;
              }
              double d10 = ((Double)this.j.get(i4)).doubleValue();
              localObject2 = new n(new a.d.w(d3, d10), new a.d.w(d4, d10));
              if (bool2) {
                break label718;
              }
              localz.add(localObject2);
              i4++;
              if (bool1) {
                break label716;
              }
            } while (!bool1);
          } while (bool2);
          if (i2 != 0) {
            break label716;
          }
          localz.j();
          break label716;
        }
        if (bool2) {}
      }
      else if (i2 >= i3)
      {
        if (m >= n)
        {
          a(parambb2, false, parambb1);
          n++;
        }
        d9 = ((Double)this.j.get(m + 1)).doubleValue();
        localObject1 = new n(new a.d.w(d3, d9), new a.d.w(d4, d9));
        localz.add(localObject1);
        break label716;
      }
      if (i1 <= 0)
      {
        a(parambb2, true, parambb1);
        i1++;
      }
      label669:
      double d9 = ((Double)this.j.get(i1 - 1)).doubleValue();
      localObject1 = new n(new a.d.w(d3, d9), new a.d.w(d4, d9));
      localz.add(localObject1);
    }
    label716:
    label718:
    return localz;
  }
  
  private void a(bb parambb1, boolean paramBoolean, bb parambb2)
  {
    boolean bool2 = a.wb;
    boolean bool1 = a.vb;
    double d1 = a;
    double d2;
    if (paramBoolean)
    {
      a.c.w localw = parambb1.l();
      do
      {
        if (!localw.e()) {
          break;
        }
        e locale = localw.d();
        int m = this.i.getInt(locale) + 1;
        this.i.a(locale, m);
        localw.f();
      } while (!bool1);
      d2 = 0.0D;
      if (!bool2)
      {
        if (this.j.size() > 0) {
          d2 = ((Double)this.j.get(0)).doubleValue();
        }
        if (bool2) {}
      }
      else
      {
        if (this.j.size() <= 1) {
          break label157;
        }
      }
      double d3 = ((Double)this.j.get(1)).doubleValue();
      d1 = d3 - d2;
      label157:
      Double localDouble1 = new Double(d2 - d1);
      this.j.add(0, localDouble1);
      if (!bool2) {
        if (!bool1) {
          return;
        }
      }
    }
    else
    {
      d2 = 0.0D;
    }
    if (!bool2)
    {
      if (this.j.size() > 0) {
        d2 = ((Double)this.j.get(this.j.size() - 1)).doubleValue();
      }
      if (bool2) {}
    }
    else
    {
      if (this.j.size() <= 1) {
        break label280;
      }
    }
    double d4 = ((Double)this.j.get(this.j.size() - 2)).doubleValue();
    d1 = d2 - d4;
    label280:
    Double localDouble2 = new Double(d2 + d1);
    this.j.add(localDouble2);
  }
  
  private int a(o paramo, bb parambb)
  {
    boolean bool2 = a.wb;
    boolean bool1 = a.vb;
    int m = 0;
    this.i = db.a();
    this.j = new ArrayList();
    e[] arrayOfe = parambb.p();
    o localo = paramo;
    Arrays.sort(arrayOfe, new Comparator()
    {
      private final o val$compGraph;
      
      public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
      {
        return l.a(f.this.a(this.val$compGraph, (e)paramAnonymousObject1), f.this.a(this.val$compGraph, (e)paramAnonymousObject2));
      }
    });
    if (((bool2) || (arrayOfe != null)) && (arrayOfe.length > 0))
    {
      double d1 = paramo.q(arrayOfe[0]);
      double d2 = paramo.t(arrayOfe[0]) + d1;
      this.i.a(arrayOfe[0], 0);
      int n = 1;
      do
      {
        if (n >= arrayOfe.length) {
          break;
        }
        e locale = arrayOfe[n];
        double d4 = a(paramo, locale);
        double d5 = b(paramo, locale);
        if (bool1) {
          break label308;
        }
        if (d4 > d2)
        {
          double d6 = d1 + (d2 - d1) / 2.0D;
          this.j.add(m, new Double(d6));
          m++;
          d1 = d4;
          d2 = d5;
          if (bool2) {
            continue;
          }
          if (!bool1) {}
        }
        else
        {
          if (bool2) {
            continue;
          }
          if (d5 > d2) {
            d2 = d5;
          }
        }
        this.i.a(locale, m);
        n++;
      } while (!bool1);
      double d3 = d1 + (d2 - d1) / 2.0D;
      if (bool2) {
        break label304;
      }
      this.j.add(m, new Double(d3));
      if (bool2) {
        break label308;
      }
      if (!bool1) {
        return m;
      }
    }
    label304:
    this.j.add(m, new Double(0.0D));
    label308:
    return m;
  }
  
  private a.d.w a(double paramDouble1, double paramDouble2, Rectangle2D paramRectangle2D, t paramt)
  {
    boolean bool2 = a.wb;
    boolean bool1 = a.vb;
    t localt = new t(paramt.d() + paramRectangle2D.getWidth() / 2.0D, paramt.e() + paramRectangle2D.getHeight() / 2.0D, paramt.b() - paramRectangle2D.getWidth(), paramt.c() - paramRectangle2D.getHeight());
    double d1 = localt.d();
    double d2 = localt.e();
    double d3 = localt.b();
    double d4 = localt.c();
    if ((bool2) || (!localt.a(paramDouble1, paramDouble2)))
    {
      if (!bool2) {
        if (paramDouble1 <= d1)
        {
          if (!bool2) {
            if (paramDouble2 <= d2)
            {
              paramDouble1 = d1;
              paramDouble2 = d2;
              if ((!bool2) && (!bool1)) {
                break label409;
              }
            }
          }
          if (!bool2) {
            if (paramDouble2 <= d2 + d4)
            {
              paramDouble1 = d1;
              if ((!bool2) && (!bool1)) {
                break label409;
              }
            }
          }
          if (!bool2)
          {
            if (paramDouble2 <= d2 + d4) {
              break label409;
            }
            paramDouble1 = d1;
            paramDouble2 = d2 + d4;
          }
          if ((!bool2) && (!bool1)) {
            break label409;
          }
        }
      }
      if (!bool2) {
        if (paramDouble1 <= d1 + d3)
        {
          if (!bool2) {
            if (paramDouble2 <= d2)
            {
              paramDouble2 = d2;
              if ((!bool2) && (!bool1)) {
                break label409;
              }
            }
          }
          if ((!bool2) && (paramDouble2 <= d2 + d4)) {
            break label409;
          }
          if (!bool2)
          {
            if (paramDouble2 <= d2 + d4) {
              break label409;
            }
            paramDouble2 = d2 + d4;
          }
          if ((!bool2) && (!bool1)) {
            break label409;
          }
        }
      }
      if ((bool2) || (paramDouble1 > d1 + d3))
      {
        if (!bool2) {
          if (paramDouble2 <= d2)
          {
            paramDouble1 = d1 + d3;
            paramDouble2 = d2;
            if ((!bool2) && (!bool1)) {
              break label409;
            }
          }
        }
        if (!bool2) {
          if (paramDouble2 <= d2 + d4)
          {
            paramDouble1 = d1 + d3;
            if (!bool2) {
              if (!bool1) {
                break label409;
              }
            }
          }
          else
          {
            if (bool2) {
              break label407;
            }
          }
        }
        if (paramDouble2 > d2 + d4)
        {
          paramDouble1 = d1 + d3;
          label407:
          paramDouble2 = d2 + d4;
        }
      }
    }
    label409:
    return new a.d.w(paramDouble1, paramDouble2);
  }
  
  protected double a(o paramo, e parame)
  {
    zc localzc = paramo.d(parame);
    double d1 = Math.max(this.e, Math.min(this.f, this.g * 2.0D + localzc.d() * this.d));
    return localzc.b() + 0.5D * (localzc.d() - d1);
  }
  
  protected double b(o paramo, e parame)
  {
    zc localzc = paramo.d(parame);
    double d1 = Math.max(this.e, Math.min(this.f, this.g * 2.0D + localzc.d() * this.d));
    return localzc.b() + 0.5D * (localzc.d() + d1);
  }
  
  protected double c(o paramo, e parame)
  {
    zc localzc = paramo.d(parame);
    double d1 = Math.max(this.e, Math.min(this.f, this.g * 2.0D + localzc.c() * this.d));
    return localzc.a() + 0.5D * (localzc.c() - d1);
  }
  
  protected double d(o paramo, e parame)
  {
    zc localzc = paramo.d(parame);
    double d1 = Math.max(this.e, Math.min(this.f, this.g * 2.0D + localzc.c() * this.d));
    return localzc.a() + 0.5D * (localzc.c() + d1);
  }
  
  public static class c_
    extends t
  {
    private a.d.w h;
    public static boolean i;
    
    public c_(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4, a.d.w paramw)
    {
      super(paramDouble2, paramDouble3, paramDouble4);
      this.h = paramw;
    }
    
    public a.d.w g()
    {
      return this.h;
    }
    
    public void b(a.d.w paramw)
    {
      this.h = paramw;
    }
    
    public c_ c(t paramt)
    {
      Rectangle2D.Double localDouble1 = new Rectangle2D.Double(d(), e(), b(), c());
      Rectangle2D.Double localDouble2 = new Rectangle2D.Double(paramt.d(), paramt.e(), paramt.b(), paramt.c());
      Rectangle2D localRectangle2D = localDouble1.createIntersection(localDouble2);
      return new c_(localRectangle2D.getX(), localRectangle2D.getY(), localRectangle2D.getWidth(), localRectangle2D.getHeight(), g());
    }
  }
  
  static class b_
  {
    private double a;
    private byte b;
    public static byte d = 0;
    public static byte e = 1;
    public static byte f = 2;
    public static byte g = 3;
    
    b_(double paramDouble, byte paramByte)
    {
      this.b = paramByte;
      this.a = paramDouble;
    }
    
    public byte a()
    {
      return this.b;
    }
    
    public void a(byte paramByte)
    {
      this.b = paramByte;
    }
    
    public double c()
    {
      return this.a;
    }
    
    public void a(double paramDouble)
    {
      this.a = paramDouble;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.i.f

 * JD-Core Version:    0.7.0.1

 */